package com.example.demo.service;

import com.example.demo.entity.Cart;
import com.example.demo.exception.BusinessException;
import com.example.demo.service.model.OrderModel;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface OrderService {
    public OrderModel findById(Long Id) throws BusinessException;
    public List<OrderModel> findAllOrderByUserIdWithRange(Long UserId,Integer index,Integer limit);
    public List<OrderModel> findUserOrderByMenuName(Long userId,String menuName,Integer index,Integer limit);
    public Boolean createOrder(OrderModel orderModel) throws BusinessException;
    public Boolean confirmOrder(Long orderId) throws BusinessException;
    public Boolean deliverOrder(Long orderId) throws BusinessException;//状态改为已发货2
    public Boolean deleteOrder(Long orderId) throws BusinessException;
    public List<OrderModel> findAllOrder(Integer index,Integer limit);
    public List<OrderModel> findAllByMenuName(String menuName,Integer index,Integer limit);
    public List<OrderModel> findAllByTelephone(String telephone,Integer index,Integer limit);
    public List<OrderModel> findAllByUserName(String userName,Integer index,Integer limit);
    public Boolean payForOrder(Long orderId,Long userId) throws BusinessException;
    public Boolean createOrderByCart(Long userId, String notes) throws BusinessException;
}
